Skip to content

Add default.execution.threads server config to decouple default query parallelism from max#18622

Open
shauryachats wants to merge 1 commit into
apache:masterfrom
shauryachats:feature/default-execution-threads
Open

Add default.execution.threads server config to decouple default query parallelism from max#18622
shauryachats wants to merge 1 commit into
apache:masterfrom
shauryachats:feature/default-execution-threads

Conversation

@shauryachats
Copy link
Copy Markdown
Collaborator

@shauryachats shauryachats commented May 28, 2026

Summary

This PR Introduces pinot.server.query.executor.default.execution.threads which sets the default execution threads per query, decoupled from max.execution.threads. The reason we need this is currently max.execution.threads serves as both the hard cap and implicit default, and if we want to accomodate a new use case where we want to increase the max.execution.threads, we do not want the existing queries (without an explicit SET maxExecutionThreads to automatically scale up the execution threads) to facilitate incremental safe migration to higher execution threads.

When not configured, behavior is completely unchanged (backward compatible).

Resolution order:

  • Per-query override (SET maxExecutionThreads=N) — capped by max
  • Server default (default.execution.threads) — decoupled from max, but still capped by it
  • Server max (max.execution.threads) — legacy fallback

Example

pinot.server.query.executor.max.execution.threads=16
pinot.server.query.executor.default.execution.threads=4
  • Normal queries use 4 threads (instead of 16 in the existing setup).
  • SET maxExecutionThreads=10 → 10 threads
  • SET maxExecutionThreads=20 → 16 threads (capped)

… parallelism from max (#TBD)

Currently, `max.execution.threads` serves as both the hard cap and the
implicit default for per-query execution threads. When operators tune it
up, all queries immediately use the higher value.

This introduces `pinot.server.query.executor.default.execution.threads`
so that operators can set a lower default for normal queries while still
allowing selected queries to reach the max via `SET maxExecutionThreads`.

Resolution order:
  1. Per-query override (SET maxExecutionThreads=N) — capped by max
  2. Server default (default.execution.threads) — capped by max
  3. Server max (max.execution.threads) — legacy fallback

When not configured, behavior is unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 28, 2026

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 64.39%. Comparing base (aee5a1f) to head (972a9da).

Files with missing lines Patch % Lines
...pinot/core/plan/maker/InstancePlanMakerImplV2.java 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18622      +/-   ##
============================================
- Coverage     64.45%   64.39%   -0.06%     
  Complexity     1137     1137              
============================================
  Files          3337     3337              
  Lines        206067   206081      +14     
  Branches      32127    32129       +2     
============================================
- Hits         132816   132714     -102     
- Misses        62599    62727     +128     
+ Partials      10652    10640      -12     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-21 64.39% <94.11%> (-0.06%) ⬇️
temurin 64.39% <94.11%> (-0.06%) ⬇️
unittests 64.39% <94.11%> (-0.06%) ⬇️
unittests1 56.83% <94.11%> (+<0.01%) ⬆️
unittests2 36.92% <41.17%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shauryachats shauryachats added the configuration Config changes (addition/deletion/change in behavior) label May 29, 2026
Copy link
Copy Markdown
Contributor

@cbalci cbalci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Config changes (addition/deletion/change in behavior)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants